#include <stdio.h>

int main()
{
    int a,b,c,d;
    printf("Please enter a number:");
    scanf("%d",&a);
    b = a*a*a;
    printf("%d*%d*%d = %d = ",a,a,a,b);
    for(d = 0,c = 0;c<a;c++)
    {
        d+=a*a - a + 1 + c*2;
        printf(c?"+%d":"%d",a*a-a+1+c*2);
    }
    if(d == b)
    printf("Y\n");
    else printf("N\n");
}